﻿// <copyright file="GlobalParameters.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains global parameters used by Batch.</summary>

namespace Sqwarea.Batch
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// This class contains parameters used by Batch
    /// </summary>
    public static class GlobalParameters
    {
        /// <summary>
        /// Indicates the lower bound of the length of the new KingId queue. When the length drops below this lower bound in a checkout, a refill should occur.
        /// </summary>
        public const int NewKingsIdQueueLengthLowerBound = 100;

        /// <summary>
        /// Indicates the interval that the scheduled service of keeping the new KingId queue alive should run.
        /// </summary>
        public const double NewKingsIdQueueCheckoutIntervalSecond = 1800.0;

        /// <summary>
        /// Timeout for a scheduled run of NewKingsIdQueueDaemon, in second
        /// </summary>
        public const int NewKingsIdQueueTimeOutSeconds = 300;

        /// <summary>
        /// Indicates the volume of a refill.
        /// </summary>
        public const long NewKingsIdQueueInsertNumber = 200;

        /// <summary>
        /// Timeout for a scheduled run of TopListUpdateDaemon, in second
        /// </summary>
        public const int TopListUpdateDaemonTimeOutSeconds = 1200;

        /// <summary>
        /// Interval that a scheduled run of TopListUpdateDaemon is triggered, in second
        /// </summary>
        public const double TopListUpdateDaemonIntervalSecond = 3600.0;

        /// <summary>
        /// Timeout for a scheduled run of ConnexityChecker, in second
        /// </summary>
        public const int ConnexityCheckerTimeOutSeconds = 600;

        /// <summary>
        /// Interval that a scheduled run of ConnexityChecker is triggered, in second
        /// </summary>
        public const double ConnexityCheckerIntervalSecond = 3600.0;

        /// <summary>
        /// Timeout for treating an element of the ConnexityBreakPoint queue, in second
        /// </summary>
        public const int ConnexityNotifierTimeOutSeconds = 300;

        /// <summary>
        /// Timeout for treating an element of the ConnexityCorrectKing queue, in second
        /// </summary>
        public const int ConnexityCorrectKingTimeOutSeconds = 300;

        /// <summary>
        /// Timeout for treating an attack, in second
        /// </summary>
        public const int AttackSolverTimeOutSeconds = 60;

        /// <summary>
        /// Threshold of the connexity king queue for the service of global connexity checking service to insert new connexity tasks
        /// </summary>
        public const int ConnexityKingQueueThreshold = 100;

        /// <summary>
        /// Threshold of number of squares for a king to be inserted into the connexity king queue by the global connexity checking service
        /// </summary>
        public const int ConnexityKingSquareThreshold = 20;

        /// <summary>
        /// Threshold of the cleanable king id queue for the service to insert king id to clean
        /// </summary>
        public const int CleanableKingIdQueueThreshold = 100;

        /// <summary>
        /// Interval that a scheduled run of CleanableKingsQueueFiller is triggered, in second
        /// </summary>
        public const double CleanableKingsQueueFillerIntervalSecond = 86400.0;

        /// <summary>
        /// Timeout for a scheduled run of CleanableKingsQueueFiller, in second
        /// </summary>
        public const int CleanableKingsQueueFillerTimeOutSeconds = 1200;

        /// <summary>
        /// Timeout for cleaning logs and attacks for a king in LogsAttacksCleaner, in second
        /// </summary>
        public const int KingCleanerTimeout = 300;
    }
}
